<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>后台管理中心</title>

<style type="text/css">
	
</style>

<link rel="stylesheet" th:href="@{/css/pintuer.css}">
<link rel="stylesheet" th:href="@{/css/admin.css}">
<script th:src="@{/js/jquery-3.3.1.min.js}"></script>
<script type="text/javascript" th:src="@{/layui/layui.js}"></script>
<link rel="stylesheet" th:href="@{/layui/css/layui.css}">

<script type="text/javascript">
	layui.use('table', function() {
		var table = layui.table;
		table.render({
			elem : '#demo',
			url : "getFsortAll" // 数据接口(controller的方法)
			,
			page : true // 开启分页
			,
			height:350,
			limit : 5,
			cols : [ [ // 表头
			{
				type : 'checkbox',
				fixed : 'left'
			}, {
				field : 'sid',
				title : 'ID'
			}, {
				field : 'sname',
				title : '电影类别'
			}, {
				field : 'sremark',
				title : '备注说明'
			},{
				toolbar: '#barDemo',
				title:'操作'
			}]]
		});
		
		 table.on('tool(test)', function(obj){
			    var data = obj.data;
			    //console.log(obj)
			    if(obj.event === 'del'){
			      layer.confirm('真的要删除么', function(index){
			        obj.del();
			        layer.close(index);
			      });
			    }
		 })
	});
</script>
</head>
<body>
	<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
	
	
    <div class="layui-col-xs6">
		<div class="grid-demo">
			<div class="modal-dialog " style="width: 1200px;overflow: auto;" >
				<div class="modal-content">
					<div class="modal-body">
						<!--此处的table是layer添加数据的位置，会根据id进行定位并在demo的下面进行数据渲染-->
						<table id="demo" lay-filter="test"></table>
					</div>
				</div>
			</div>
		</div>
	</div>
  
	

</body>
</html>